I have an attribute in a header. If the attribute changes, all the object (Text as headings) below that header should have the attribute modified as the heading attribute. |
Re: Copy object heading attribute to object text inside that heading Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Copy object heading attribute to object text inside that heading Mathias Mamsch - Thu Jun 02 17:33:28 EDT 2011 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS Example. Was Heading 1 level 1 => Attribute is OK Object 1 inside level 1 => Attribute is Ok Object 2 inside level 1 => Attribute is Ok Heading 2 level 1 => Attribute is OK Object 1 inside level 1 => Attribute is Ok Object 2 inside level 1 => Attribute is Ok Action Heading level 1 => Attribute CHANGED to NOT_OK (trigger will be fired here) Object 1 inside level 1 => Attribute is Ok Object 2 inside level 1 => Attribute is Ok Heading 2 level 1 => Attribute is OK (Nothing changes) Object 1 inside level 1 => Attribute is Ok (Nothing changes) Object 2 inside level 1 => Attribute is Ok (Nothing changes) Will Be Heading level 1 => Attribute is to NOT_OK Object 1 inside level 1 => Attribute is NOT_OK (changed by the trigger) Object 2 inside level 1 => Attribute is NOT_OK (changed by the trigger) Heading 2 level 1 => Attribute is OK (Nothing changes) Object 1 inside level 1 => Attribute is Ok (Nothing changes) Object 2 inside level 1 => Attribute is Ok (Nothing changes) |
Re: Copy object heading attribute to object text inside that heading |
Re: Copy object heading attribute to object text inside that heading Silveirax - Fri Jun 03 11:35:36 EDT 2011
This may not be exactly what you want, but if you attribute had the property 'inherited' (sibling to 'default') then often when a Heading changed the value, so would all its children objects. However, if an object indeed has a specific value, such as changing "Obj 1 under Head 1" specifically to "OK", then changing the Heading will NOT change that subordinate, but will change "Obj 2 under Head 1".
bool IsSubordinate(Object oHead, oText)
{ // Is the Text object subordinate in the Hierarchy to the Heading object?
if (null oHead or null oText) return(false)
if (oHead == oText) return(false) // same object, you dim wit
if (module(oHead) != module(oText)) return(false) // in different Modules, nincompoop
string ParaH = number(oHead)
string ParaT = number(oText)
int lenH = length(ParaH)
int lenT = length(ParaT)
return (lenH < lenT and ParaT[0:LenH-1] == ParaH)
} // end IsSubordinate()
|